Memory access tracing is an important technique in the field of computer software testing and debugging. For example, memory access tracing is useful for memory leakage detecting, data race detecting and the like.
In order to provide memory access tracing, it is generally necessary to instrument computer program code (for example, source codes, object codes or the like). This is done, for example, by adding routines or instructions for obtaining and recording information, such as, target address (the address which is written into), length of written data, visit type (for example, load or store), thread identification and so on, about memory access instructions (for example, instructions for writing into the memory), or instructions for invoking these routines or instructions, before or after the memory access instructions.
As compared to program codes without such instrumentation, the instrumented program codes have an additional overhead for memory access tracing, especially in the case that the program codes include more memory access instructions or the memory access instructions are executed in a large number of times.
Therefore, there is needed a technique for providing memory access tracing while reducing such overhead.